<template>
	<div>
		
		<van-tabs  v-model="active">
		  <van-tab title="全部评论(132)">
		  
			 <div v-for='com in comment'>
			  			 <van-cell :icon="com.avatar" color="#F97899"  :title="com.nickname" :value="com.addTime" />
			  			 <div class="plun">
			  			 			 {{com.content}}
			  			 </div>
			  </div>
			  
		  </van-tab>
		  <van-tab title="有图评论">
			 
			 <div v-for='com in comment'>
			 			 <van-cell  color="#F97899"  :title="com.nickname" :value="com.addTime" />
			 			 <div class="plun">
			 			 			 {{com.content}}
			 			 </div>
			 </div>
			 
		  </van-tab>
		  
		</van-tabs>
		
	</div>
</template>

<script>
	import { Tab, Tabs } from 'vant';
	import API from '../utils/API.js'
	export default {
	  data() {
	    return {
	      active: 2,
		  comment:null,
		  id:null,
		  comment:null
	    };
	  },
	   mounted(){
		     this.id = this.$route.query.id 
		  this.$get(API.GET_GOODS_DETAIl,{
		  			  id:this.id
		  })
		  .then(res => {
			  
			  this.comment = res.data.data.comment.data
			  console.log(res.data.data.comment.data)
		  })
	   },
	  components:{
		  [Tab.name]:Tab,
		    [Tabs.name]:Tabs,
	  }
	};
</script>

<style>

	.van-tab--active{
		color: red;
	}
	.van-tabs__content{
		padding: 0 15px;
	}
</style>
